import request from '@/utils/request'

//查询全部题库信息
export const getTotalTitle = (id) => {
    return request.get(`/exam/T_question/list?subId=${id}`)
}

//插入题目
export const insertNewTitle = (data) => {
    return request.post('/exam/T_question/add', data)
}

//更新题目信息
export const updataTitleContent = (data) => {
    // data = JSON.stringify(data)
    return request.put(`/exam/T_question/update/${data.id}`, data)
}

// 通过id来查看题目信息
export const getIDTitle = (id) => {
    return request.get(`/exam/T_question/info/${id}`)
}

//通过id来查看答案内容
export const getTitleAnswer = (id) => {
    return request.get(`/exam/T_answer/info/${id}`)
}

//删除题目
export const deleteTitleData = (id) => {
    return request.delete(`/exam/T_question/delete/${id}`)
}

//通过科目查看科目题库信息
export const getSubjectTitle = () => {
    return request.get('/exam/T_question/subject')
}
//文件批量导入
// export const insertFileTitle = () => {
//     return request.get()
// }

//题库类型统计
export const getTotalTitleNum = (id) =>{
    return request.get(`/exam/T_question/getnumQuestionType?subid=${id}`)
}

//题型难度统计
export const getDifficultyNum = (id) =>{
    return request.get(`/exam/T_question/getdifficultyQuestionType?subid=${id}`)
}

//标签数量统计
export const getTagNum = (id) =>{
    return request.get(`/exam/T_question/getlabelQuestionType?subid=${id}`)
}

//年份导入题库统计
export const getYearNum = (id) =>{
    return request.get(`/exam/T_question/getcreatedAtQuestionType?subid=${id}`)
}
// //题型知识点统计
// export const getTypeKnowledgeNum = (id) =>{
//     return request.get(`/exam/T_question/getlabelQuestionType1?subid=${id}`)
// }

//题型知识点统计
export const getTypeKnowledgeNum = (id) =>{
    return request.get(`/exam/T_question/getlabelQuestionType1?subid=${id}`)
}

//难度知识点统计
export const getDifficultyKnowledgeNum = (id) =>{
    return request.get(`/exam/T_question/getlabelQuestiondifficulty?subid=${id}`)
}

//题型难度统计
export const getQuestionTypesDifficultyNum = (id) =>{
    return request.get(`/exam/T_question/getlabelQuestiondifficulty1?subid=${id}`)
}